package com.ict.txmsv2.services;

import com.ict.txmsv2.mapper.RoleMapper;
import com.ict.txmsv2.model.RespBean;
import com.ict.txmsv2.model.Role;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author linzzz
 * @desc ...
 * @date 2020-12-16
 */
@Service
public class RoleService {
    @Autowired
    RoleMapper roleMapper;

    public List<Role> getAllRole() {
        return roleMapper.getAllRole();
    }

    public int addRole(Role role) {
        return roleMapper.insertSelective(role);
    }

    public int updateRole(Role role) {
        return roleMapper.updateByPrimaryKeySelective(role);
    }

    public int delRole(Integer rid) {
        return roleMapper.deleteByPrimaryKey(rid);
    }

    public Integer[] getMidsByRid(Integer id) {
        return roleMapper.getMidsByRid(id);
    }
}
